<?php


namespace app\api\controller\v1;


use app\adminapi\controller\AuthController;
use app\services\exam\ExamRecordService;
use think\facade\App;

class StudentTestRecord extends AuthController
{
    public function __construct(App $app, ExamRecordService $service)
    {
        parent::__construct($app);
        $this->services = $service;
    }

    /*
     * 学生考试保存
     */
    public function index()
    {

        $where = $this->request->postMore([
            ['website_id', $this->website],
            ['start_face', ''],
            ['middle_face', ''],
            ['end_face', ''],
            ['class_id', ''],
            ['exam_id', ''],
            ['major_id', ''],
            ['level', ''],
            ['idcard', ''],
            ['submit_type', ''],
            ['user_name', ''],
            ['exam_type', ''],
            ['content', ''],
            ['total_score', ''],
            ['robot_score', ''],
            ['pass_score', ''],
            ['start_time', ''],
            ['end_time', date('Y-m-d H:i:s')],
            ['examStart_time', ''],
            ['examEnd_time', ''],
            ['is_normal', ''],
            ['hint_msg', ''],
        ]);

        return app()->make('json')->successful($this->services->testRecord($where));
    }

}